<template>
  <div class="row">
    <div class="col-sm-2 flex">
      <!-- 特殊类型选择区域 -->

      <div class="span">
        <div  class="auto" style="display: inline-block;">
         <input class="magic-radio" type="radio" name="radio" id="diswork-radio-one" value="档案类型" v-model="filetype">
         <label for="diswork-radio-one">档案类型</label>
       </div>
       <div class="auto" style="display: inline-block;">
         <input class="magic-radio" type="radio" name="radio" id="diswork-radio-two" value="业务类型" v-model="filetype">
         <label for="diswork-radio-two">业务类型</label>
       </div>
        <file-types v-if='filetype === "档案类型"' @filetypes-change="typesChange"></file-types>
        <query-types v-if='filetype === "业务类型"' @types-change="typesChange"></query-types>
      </div>
      <!-- 汇总显示区域 -->
      <!-- <div class="span">
        <synth-summary></synth-summary>
      </div> -->
    </div>
    <!-- 真实查询 -->
    <div class="col-sm-10">
      <query-actually :types="types" :typename="filetype"></query-actually>
    </div>
  </div>
</template>

<script>
// import userData from './left/fileconfig'
// import bussinessData from './config'
export default {
  title: '综合查询',
  data () {
    return {
      filetype: '业务类型',
      types: []
    }
  },
  methods: {
    typesChange (types) {
      console.log('选取，，，', types)
      if (types instanceof Array) {
        this.types = types
      } else {
        this.types = [types]
      }
    }
  },
  watch: {
    'filetype' (val) {
      // this.types = val === '业务类型' ? bussinessData.allData[0] : userData.allData[0]
      console.log(this.types)
      this.types = []
    }
  }
}
</script>
